<center>
    This is the homepage!
{if $logged}Logged{else}Not Logged{/if}

{if $logged}
	<a href="/chat-public">Chat</a><br />
	<a href="/user/logout">Logout</a><br />
{/if}

<form action="/user/login" method="post">
	<table>
		<tr>
			<td>Username</td>
			<td>
				<input type="text" name="username" id="form_user">
			</td>
		</tr>
		<tr>
			<td>Password</td>
			<td>
				<input type="password" name="password" id="form_pass">
			</td>
		</tr>
		<tr>
			<td>
				<input type="submit" value="Login">
			</td>
		</tr>
	</table>
</form>

<form action="/user/register" method="post">
	<table>
		<tr>
			<td>Username</td>
			<td>
				<input type="text" name="username" id="form_user">
			</td>
		</tr>
		<tr>
			<td>Password</td>
			<td>
				<input type="password" name="password" id="form_pass">
			</td>
		</tr>
		<tr>
			<td>
				<input type="submit" value="Register" id="register_button">
			</td>
		</tr>
	</table>
	<input type="hidden" name="localhour" id="localhour" value="">
</form>

<table border="1">
    {foreach from=$debug key=k item=v}
    <tr>
        <td>{$k}</td>
        <td>
			{if is_array($v)}
				<table style="width: 100%;">
				{foreach from=$v key=v_k item=v_v}
					<tr>
						<td>
							{$v_k}
						</td>
						<td>
							{$v_v}
						</td>
					</tr>
				{/foreach}
				</table>
			{else}
				{$v}
			{/if}
        </td>
    </tr>
    {/foreach}
</table>
</center>


<script>
	$(document).ready( function()
	{
		var dt = new Date();
		$('#localhour').val( dt.getHours() );
	} );
</script>